{% extends "base.html" %}

{% block head %}
<title>index page</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
{% endblock %}

{% block navbar %}
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
  <a class="navbar-brand">RateMap</a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <div class="collapse navbar-collapse" id="navbarNav">
    <ul class="navbar-nav">
      <li class="nav-item">
        <a class="nav-link" href="{{url_for('index')}}">主页</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="{{url_for('surround')}}">周边推荐</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="{{url_for('user_analysis')}}">用户分析</a>
      </li>
      <li class="nav-item active">
        <a class="nav-link" href="{{url_for('shop_analysis')}}">店铺分析</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="{{url_for('area_analysis')}}">区域分析</a>
      </li>
    </ul>
  </div>
</nav>
{% endblock %}

{% block content %}
{% if shopname %}
<table class="table table-hover">
  <thead>
    <tr>
      <th scope="col">店铺名称</th>
      <th scope="col">综合评分</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{shopname}}</td>
      <td>{{rating}}</td>
    </tr>
  </tbody>
</table>
{% endif %}
{% if shops_dict %}
<table class="table table-hover">
  <thead>
    <tr>
      <th scope="col">店铺名称</th>
      <th scope="col">综合评分</th>
      <th scope="col">所在城市</th>
      <th scope="col">地址</th>
      <th scope="col">店铺类型</th>
    </tr>
  </thead>
  <tbody>
    {% for shop in shops_dict %}
    <tr>
        <td>{{shop['name']}}</td>
        <td>{{shop['stars']}}</td>
        <td>{{shop['city']}}</td>
        <td>{{shop['address']}}</td>
        <td>{{shop['categories']}}</td>
      </tr>
    {% endfor %}
  </tbody>
</table>
{% endif %}
{% endblock %}
